package musicchange;

import java.io.File;

import main.FileOperations;
import main.FinishWindow;
import exceptions.NotDirException;

public class Pack {
	File dir;

	public Pack(String path) {
		try {
			dir = FileOperations.checkDir(path);
			boolean end =  packToDirs();
			System.out.println("State of packing: " + end);
			if(end){
				FinishWindow.main(null);
			}
		} catch (NotDirException e) {
			System.out.println(e.getStackTrace());
		}
	}

	private boolean packToDirs() {
		FileOperations.showContent(dir);
		FileOperations.makeDirs(dir);
		FileOperations.moveToDirs(dir);
		return true;
	}

}
